/**
 * Height
 * This class represents a patient's recorded height (in feet/inches)
 * Subclass of Vitals
 */
package docoffice.doss;
import java.util.logging.Logger;
/**
 * @author George Chi
 * @version  $Revision: 1.8 $
 */
public class Height extends Vitals {
	
	/**
	 * Field SOMECONSTANT.
	 * (value is 0.3048)
	 */
	public static final double CONVERSIONFACTOR = .3048;
	
	/**
	 * Field heightFeet.
	 */
	public int heightFeet;

	/**
	 * Field heightInches.
	 */
	public int heightInches;

	/**
	 * Field heightMeters.
	 */
	public double heightMeters;
	
	/**
	 * Field LOG.
	 */
	private static final Logger LOG = Logger.getLogger("Height");

	/**
	 * Field INCHES.
	 */
	private static final int INCHES = 12;
	
	/**
	 * Constructor for Height.
	 * @param patientPulse int
	 * @param patientFeet int
	 * @param patientInches int
	 */
	public Height(int patientPulse, int patientFeet, int patientInches) {
		super(patientPulse);
		setHeightFeet(patientFeet);
		setHeightInches(patientInches);
	}
	
	/**
	 * Method convertToMeters.
	 * @param feet int
	 * @param inches int
	
	 * @return double */
	public double convertToMeters(int feet, int inches) {
		LOG.entering("Height", "convertToMeters");
		// 1 meter = 3.2808399 feet, 1 foot = 0.3048 meters
		
		final int tempIn = inches;
		final int tempFeet = feet;
		final double tempHeightInFeet = tempFeet + (tempIn / INCHES);
		
		heightMeters = (tempHeightInFeet * CONVERSIONFACTOR);
		LOG.exiting("Height", "convertToMeters");
		return heightMeters;
	}
	
	/**
	 * Method setHeightInches.
	 * @param heightInches int
	 */
	public final void setHeightInches(int heightInches) {
		this.heightInches = heightInches;
	}

	/**
	 * Method getHeightInches.
	 * @return int 
	 */
	public int getHeightInches() {
		return heightInches;
	}

	/**
	 * Method setHeightFeet.
	 * @param heightFeet int
	 */
	public final void setHeightFeet(int heightFeet) {
		this.heightFeet = heightFeet;
	}

	/**
	 * Method getHeightFeet.
	 * @return int 
	 */
	public int getHeightFeet() {
		return heightFeet;
	}

}
